<template>
  <table class="pvtTable">
    <VPivottableHeader
      :row-total="props.showRowTotal"
      :localeStrings="props.localeStrings"
      :aggregatorName="props.aggregatorName"
      :fields="fields"
      :groupMode="groupMode"
    />
    <VPivottableBody
      :row-total="props.showRowTotal"
      :table-options="props.tableOptions"
      :localeStrings="props.localeStrings"
      :groupMode="groupMode"
    />
  </table>
</template>

<script setup>
import { defaultProps } from '@/pivottable/helper'
import { providePivotData } from '@/pivottable/composables/useProvidePivotData'
import VPivottableHeader from '../VPivottableHeader.vue'
import VPivottableBody from '../VPivottableBody.vue'

const props = defineProps({
  ...defaultProps,
  localeStrings: {
    type: Object,
  },
  tableOptions: {
    type: Object,
    default: () => ({
      clickCallback: null
    })
  }
})
providePivotData(props)
</script>
